<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			/* 子绝父相 */
			* {
				margin: 0;
			}

			.box1 {
				width: 100%;
				height: 200px;
				background-color: red;
				position: fixed;
				z-index: 100;
			}

			.box2 {
				/* width: 500px; */
				height: 200px;
				background-color: yellow;
				border: 1px solid black;
				/* 绝对定位:脱标 参考点：整个页面*/
				/* position: absolute; */
				/* 相对定位 */
				position: relative;
				/* top: 10px; */
				/* left: 10px; */
				/* right: 10px; */
				bottom: 10px;
				padding: 30px;
			}

			.box3 {
				width: 500px;
				height: 200px;
				background-color: blue;
			}

			.box4 {
				width: 300px;
				height: 100px;
				background-color: green;
				position: absolute;
				top: 10px;
				left: 50%;
				margin-left: -150px;
			}
		</style>
	</head>
	<body>
		<div class="box1"></div>
		<div class="box2">
			<div class="box4"></div>
		</div>
		<div class="box3"></div>
	</body>
</html>
